//
//  ClassListTableFooterView.m
//  huashiedu
//
//  Created by oceans on 2018/8/28.
//  Copyright © 2018年 hema. All rights reserved.
//

#import "ClassListTableFooterView.h"

@implementation ClassListTableFooterView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    
    self = [super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        [self setup];
    }
    return self;
}

- (void)setup {
    
    self.backgroundColor = COLOR(245, 245, 245, 1);
    UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 0.868 * ScreenWidth - 19)];
    backView.backgroundColor = [UIColor whiteColor];
    [self addSubview:backView];
    
    UIImageView *imageview = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth * 0.45, ScreenWidth * 0.45 * 0.717)];
    imageview.image = [UIImage imageNamed:@"classlist_empty"];
    imageview.center = CGPointMake(ScreenWidth * 0.5, (0.868 * ScreenWidth - 19) * 0.35);
    [backView addSubview:imageview];
    
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(imageview.frame), ScreenWidth, 21)];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.font = [UIFont systemFontOfSize:13];
    titleLabel.textColor = COLOR(128, 128, 128, 1);
    titleLabel.text = @"未找到相关课程，快发布一个需求吧！";
    [backView addSubview:titleLabel];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.backgroundColor = COLOR(253, 119, 77, 1);
    button.frame = CGRectMake(0, 0, 122, 37);
    button.center = CGPointMake(ScreenWidth * 0.5, backView.bounds.size.height * 0.737);
    [button setTitle:@"发布需求" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(sendButtonPressed) forControlEvents:UIControlEventTouchUpInside];
    button.titleLabel.font = [UIFont systemFontOfSize:15.0];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [backView addSubview:button];
}

- (void)sendButtonPressed {
    
    [_delegate footerViewSendButtonPressed];
}

@end
